import request from '@/utils/request'

// 查询业内资料目录-详情列表
export function listDetail(query) {
  return request({
    url: '/detail/detail/list',
    method: 'get',
    params: query
  })
}

// 查询业内资料目录-详情详细
export function getDetail(id) {
  return request({
    url: '/detail/detail/' + id,
    method: 'get'
  })
}

// 新增业内资料目录-详情
export function addDetail(data) {
  return request({
    url: '/detail/detail',
    method: 'post',
    data: data
  })
}

// 新增业内资料目录-详情
export function submitFormAdd(data) {
  let id = {
    id: data.id
  }
  data.id = undefined
  return request({
    url: '/detail/detail/lower',
    method: 'post',
    data: data,
    params:id
  })
}


// 修改业内资料目录-详情
export function updateDetail(data) {
  return request({
    url: '/detail/detail',
    method: 'put',
    data: data
  })
}

// 删除业内资料目录-详情
export function delDetail(id) {
  return request({
    url: '/detail/detail/' + id,
    method: 'delete'
  })
}

// 关联附件和业内资料目录详情
export function relateDetailAttaches(data) {
  return request({
    url: '/detail/detail/relateAttaches',
    method: 'post',
    data: data
  })
}